#!/bin/bash
set -v
# Check if erasure_env:base exists
docker images | grep "erasure_env" | grep "base"

# If not, exit
if [[ $? -ne 0 ]]; then
    echo Image erasure_env:base not found, exit.
    exit 1
fi

tar cvf ref.tar \
    --exclude=../.git \
    --exclude=../cache \
    --exclude=../compilation_env \
    --exclude=../standalone \
    ../..

docker build -t erasure_env:full .

rm ref.tar

